import Vue from 'vue'
import Router from 'vue-router'
import App from '@/App'
import equipmentMessage from '@/page/equipment/equipmentMessage'
import equipmentBind from '@/page/equipment/equipmentBind'
import userManage from '@/page/user/userManage'
import login from '@/page/login/login'
import dataLog from '@/page/log/dataLog'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path:'',
      redirect:'/login'
    },{
      path: '/login',
      name: 'login',
      component: login
    },
    {
      path: '/system/',
      component: App,
      children: [
        {
          path: 'equipmentMessage',
          // component: equipmentMessage,
          component: r => require.ensure([], () => r(require('@/page/equipment/equipmentMessage')), 'equipmentMessage')
        }, {
          path: 'userManage',
          component: r => require.ensure([], () => r(require('@/page/user/userManage')), 'userManage')
        }, {
          path: 'equipmentBind',
          component: r => require.ensure([], () => r(require('@/page/equipment/equipmentBind')), 'equipmentBind')
        }, {
          path: 'alarmLog',
          component: r => require.ensure([], () => r(require('@/page/log/alarmLog')), 'alarmLog')
        }, {
          path: 'dataLog',
          component: r => require.ensure([], () => r(require('@/page/log/dataLog')), 'dataLog')
        }]
    }]
})
